(function() {

    var
    $u = juliet.using({
        validationResult : 'juliet.validation.validationResult',
        validator : 'juliet.validation.validator'
    }),
    vr = $u('validationResult');

    /**
     * Not empty validator
     */
    var NotEmptyClass = function() {

        this.validate = function() {
            var value = this.chain.fieldValueHelper.fieldValue;
            this.result = (value && (value.length > 0)) ? vr.SUCCESS : vr.FAILED;
        };

        this.getError = function() {
            return this.base.getError.call(this, 'not-empty');
        };

    };

    $u('validator').addValidator('NotEmpty', NotEmptyClass);

})();
